Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor workspace libraries handling #400

Merged
merged 6 commits into from Jan 3, 2019

Conversation

ubruhin
Copy link
Member

@ubruhin ubruhin commented Dec 28, 2018

Update version of workspace library database to v2

  • Store PNG icon of libraries in database. Used to get library icons without loading the libraries (useful for the library manager).
  • Use "ON DELETE CASCADE" for foreign keys. Required to allow removing single libraries from the database without generating a foreign key error. Used to speed-up scanning of installed libraries.

WorkspaceLibraryDb: Add more methods to query data

Add support for reading more data from the database, especially library metadata.

Refactor and improve scanning of workspace libraries

WorkspaceLibraryScanner now also scans which libraries are installed instead of using the libraries loaded by the Workspace object. This allows to add/remove/update workspace libraries without notifying the Workspace object about the exact changes. To get faster feedback of the changes (e.g. to update the widgets of the library manager), the scanner now emits a signal after the library list is updated.

In addition, the scanner now emits a new signal scanFinished() which is used in many classes to get notified even if the scan fails or was aborted.

Also the debug output is now a bit more verbose to see more information about the library scan.

Restart workspace library scanner when triggered

Until now, the workspace library scanner was not restarted on every trigger, thus triggers while the scan was running were lost, which lead to outdated information in the database. Now the scan is immediately restarted if it is triggered while already running. This avoids outdated information, and is important to keep the list of libraries (especially in the library manager) always up to date when libraries are added or removed.

LibraryManager: Use library metadata from database

Because now we have more library metadata in the database.

Workspace: Don't load libraries at startup

Using libraries from the database instead -> Faster startup, and avoids message boxes if libraries can't be loaded.

- Store PNG icon of libraries in database. Used to get library icons
  without loading the libraries (useful for the library manager).
- Use "ON DELETE CASCADE" for foreign keys. Required to allow removing
  single libraries from the database without generating a foreign key
  error. Used to speed-up scanning of installed libraries.
Add support for reading more data from the database, especially library
metadata.
WorkspaceLibraryScanner now also scans which libraries are installed
instead of using the libraries loaded by the Workspace object. This
allows to add/remove/update workspace libraries without notifying the
Workspace object about the exact changes. To get faster feedback of the
changes (e.g. to update the widgets of the library manager), the scanner
now emits a signal after the library list is updated.

In addition, the scanner now emits a new signal scanFinished() which is
used in many classes to get notified even if the scan fails or was
aborted.

Also the debug output is now a bit more verbose to see more information
about the library scan.
Until now, the workspace library scanner was not restarted on every
trigger, thus triggers while the scan was running were lost, which lead
to outdated information in the database. Now the scan is immediately
restarted if it is triggered while already running. This avoids outdated
information, and is important to keep the list of libraries (especially
in the library manager) always up to date when libraries are added or
removed.
@ubruhin ubruhin force-pushed the refactor-workspace-libraries-handling branch from 8c4131e to 7a2b0ab Compare January 1, 2019 20:13
@ubruhin ubruhin force-pushed the refactor-workspace-libraries-handling branch from 7a2b0ab to 79c8426 Compare January 1, 2019 20:35
@ubruhin ubruhin merged commit dbc6805 into master Jan 3, 2019
@ubruhin ubruhin deleted the refactor-workspace-libraries-handling branch January 3, 2019 20:03
ubruhin added a commit that referenced this pull request Mar 17, 2019
…ndling

Refactor workspace libraries handling
(cherry picked from commit dbc6805)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

1 participant